Blitz (101/144)

From:David McMinn
Date:24 May 2001 at 02:31:47
Subject:Re: Displayscroll

Jason Faramus says the moon is made of cheese, but it's actually made of Displayscroll

> I'm now stuck with the Display Scroll command. I've been fiddling with
> it for ages but am still having trouble. (Once again thanks to the
> useless description in the docs...) How does it work? Am I right in
> thinking that it can do the same as hardware scrolling i.e. shift the
> screen around as a whole or can it just be used to position individual
> lines? If it can do the above how would I go about setting this kind of
> display up?

Don't use it for hardware scrolling (assuming you only want to move the
displayed area of the bitmap), you'd be better using the x,y parameters of
DisplayBitMap for that.

Yes, DisplayScroll can position individual lines. The two parameters are
pointers to arrays (of .q type) for the front and back playfields, and
each value in the array is the amount to the right (I think) that the line
is shifted compared to the left. For example, if in your array you had:

Dim xpos.q(256) ; Should do one value in the array for each line of the
; display that DisplayScroll will be used on. So we use
; 256 for a full PAL display.

xpos(1)=3 ; All the rest will default to 0
xpos(3)=-2
xpos(4)=5

Your display will look like this

==========... First line
=======... Line 1
=======... Line 2
=========... Line 3
=========... Line 4
====... Line 5

And all the rest will align with that last one (cos they have an offset of
0). Obviously the blanks in the diagram above will be filled by whatever
is to the left of the first pixel, so you need to make sure your bitmap is
a bit wider than the display, or you will end up displaying the last part
of the previous line.

In the coed I think you use it like DisplayScroll 0,&xpos(0),&xpos2(0)
where xpos is the array of offsets for the front playfield and xpos2 is
the array of offsets for the back playfield (if you have a dual playfield
display, if not, make them both &xpos(0)).

You also need to reserve 4 custom instructions per line (subtract 4 from
the numcustoms parameter when you use InitCopList). I did have some code
which I was playing around with trying to get it to work, but I can't seem
to find it now.

Bye



[) /\ \/ ][ [) |\/| © |\/| ][ |\| |\| | dave@blitz-2000.co.uk
http://members.nbci.com/david_mcminn | ICQ = 16827694
Don't tell me I'm still on this feckin' island!!!
- Father Jack Hackett, Father Ted.

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list/-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list/-help@netsoc.ucd.ie